.class public Lcom/bitauto/autoeasy/news/NewsUpdateTask;
.super Landroid/os/AsyncTask;
.source "NewsUpdateTask.java"


# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "Landroid/os/AsyncTask",
        "<",
        "Ljava/lang/String;",
        "Ljava/lang/String;",
        "Ljava/lang/String;",
        ">;"
    }
.end annotation


# instance fields
.field private TAG:Ljava/lang/String;

.field private activity:Lcom/bitauto/autoeasy/news/NewsActivity;

.field private flag:I

.field private list:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Lcom/bitauto/autoeasy/news/Object/News;",
            ">;"
        }
    .end annotation
.end field

.field private url:Ljava/lang/String;


# direct methods
.method public constructor <init>()V
    .locals 1

    .prologue
    .line 29
    invoke-direct {p0}, Landroid/os/AsyncTask;-><init>()V

    .line 18
    const-string v0, "NewsUpdateTask"

    iput-object v0, p0, Lcom/bitauto/autoeasy/news/NewsUpdateTask;->TAG:Ljava/lang/String;

    .line 30
    return-void
.end method

.method public constructor <init>(Lcom/bitauto/autoeasy/news/NewsActivity;Ljava/lang/String;I)V
    .locals 1
    .parameter "activity"
    .parameter "url"
    .parameter "flag"

    .prologue
    .line 22
    invoke-direct {p0}, Landroid/os/AsyncTask;-><init>()V

    .line 18
    const-string v0, "NewsUpdateTask"

    iput-object v0, p0, Lcom/bitauto/autoeasy/news/NewsUpdateTask;->TAG:Ljava/lang/String;

    .line 23
    iput-object p2, p0, Lcom/bitauto/autoeasy/news/NewsUpdateTask;->url:Ljava/lang/String;

    .line 24
    iput-object p1, p0, Lcom/bitauto/autoeasy/news/NewsUpdateTask;->activity:Lcom/bitauto/autoeasy/news/NewsActivity;

    .line 25
    iput p3, p0, Lcom/bitauto/autoeasy/news/NewsUpdateTask;->flag:I

    .line 26
    return-void
.end method


# virtual methods
.method protected bridge varargs synthetic doInBackground([Ljava/lang/Object;)Ljava/lang/Object;
    .locals 1
    .parameter

    .prologue
    .line 1
    check-cast p1, [Ljava/lang/String;

    invoke-virtual {p0, p1}, Lcom/bitauto/autoeasy/news/NewsUpdateTask;->doInBackground([Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method protected varargs doInBackground([Ljava/lang/String;)Ljava/lang/String;
    .locals 2
    .parameter "params"

    .prologue
    .line 39
    iget-object v0, p0, Lcom/bitauto/autoeasy/news/NewsUpdateTask;->activity:Lcom/bitauto/autoeasy/news/NewsActivity;

    iget-object v1, p0, Lcom/bitauto/autoeasy/news/NewsUpdateTask;->url:Ljava/lang/String;

    invoke-virtual {v0, v1}, Lcom/bitauto/autoeasy/news/NewsActivity;->getList(Ljava/lang/String;)Ljava/util/ArrayList;

    move-result-object v0

    iput-object v0, p0, Lcom/bitauto/autoeasy/news/NewsUpdateTask;->list:Ljava/util/ArrayList;

    .line 40
    const/4 v0, 0x0

    return-object v0
.end method

.method protected bridge synthetic onPostExecute(Ljava/lang/Object;)V
    .locals 0
    .parameter

    .prologue
    .line 1
    check-cast p1, Ljava/lang/String;

    invoke-virtual {p0, p1}, Lcom/bitauto/autoeasy/news/NewsUpdateTask;->onPostExecute(Ljava/lang/String;)V

    return-void
.end method

.method protected onPostExecute(Ljava/lang/String;)V
    .locals 3
    .parameter "result"

    .prologue
    const/4 v2, 0x0

    .line 45
    iget-object v0, p0, Lcom/bitauto/autoeasy/news/NewsUpdateTask;->list:Ljava/util/ArrayList;

    if-eqz v0, :cond_1

    iget-object v0, p0, Lcom/bitauto/autoeasy/news/NewsUpdateTask;->list:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v0

    if-lez v0, :cond_1

    .line 46
    iget-object v0, p0, Lcom/bitauto/autoeasy/news/NewsUpdateTask;->activity:Lcom/bitauto/autoeasy/news/NewsActivity;

    iget-object v1, v0, Lcom/bitauto/autoeasy/news/NewsActivity;->tempid:Ljava/lang/String;

    iget-object v0, p0, Lcom/bitauto/autoeasy/news/NewsUpdateTask;->list:Ljava/util/ArrayList;

    invoke-virtual {v0, v2}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/bitauto/autoeasy/news/Object/News;

    invoke-virtual {v0}, Lcom/bitauto/autoeasy/news/Object/News;->getModifytime()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    .line 47
    iget-object v0, p0, Lcom/bitauto/autoeasy/news/NewsUpdateTask;->TAG:Ljava/lang/String;

    const-string v1, "No Date for refresh"

    invoke-static {v0, v1}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 49
    :cond_0
    iget v0, p0, Lcom/bitauto/autoeasy/news/NewsUpdateTask;->flag:I

    if-nez v0, :cond_2

    .line 50
    iget-object v0, p0, Lcom/bitauto/autoeasy/news/NewsUpdateTask;->activity:Lcom/bitauto/autoeasy/news/NewsActivity;

    iget-object v1, p0, Lcom/bitauto/autoeasy/news/NewsUpdateTask;->list:Ljava/util/ArrayList;

    invoke-virtual {v0, v1}, Lcom/bitauto/autoeasy/news/NewsActivity;->updateList(Ljava/util/ArrayList;)V

    .line 55
    :cond_1
    :goto_0
    sget-object v0, Lcom/bitauto/autoeasy/MainActivity;->mainActivity:Lcom/bitauto/autoeasy/MainActivity;

    invoke-virtual {v0, v2}, Lcom/bitauto/autoeasy/MainActivity;->setTitleProgressBar2(Z)V

    .line 56
    return-void

    .line 52
    :cond_2
    iget-object v0, p0, Lcom/bitauto/autoeasy/news/NewsUpdateTask;->activity:Lcom/bitauto/autoeasy/news/NewsActivity;

    iget-object v1, p0, Lcom/bitauto/autoeasy/news/NewsUpdateTask;->list:Ljava/util/ArrayList;

    invoke-virtual {v0, v1}, Lcom/bitauto/autoeasy/news/NewsActivity;->updateList2(Ljava/util/ArrayList;)V

    goto :goto_0
.end method

.method protected onPreExecute()V
    .locals 2

    .prologue
    .line 34
    sget-object v0, Lcom/bitauto/autoeasy/MainActivity;->mainActivity:Lcom/bitauto/autoeasy/MainActivity;

    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Lcom/bitauto/autoeasy/MainActivity;->setTitleProgressBar2(Z)V

    .line 35
    return-void
.end method
